package com.golte.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @className: OrgDto
 * @description: 机构返回
 * @author:
 * @date: 2021/5/31
 **/
@Data
@Builder
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrgDto {
    @ApiModelProperty(value = "机构代码", dataType = "String")
    private String code;
    @ApiModelProperty(value = "机构名称", dataType = "String")
    private String name;

    @ApiModelProperty(value = "子机构", dataType = "List")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<OrgDto> childs;

    @ApiModelProperty(value = "当前机构人员列表", dataType = "List")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<UserDto> listUser;

    @ApiModelProperty(value = "当前机构人员", dataType = "Integer")
    private Integer count;

    @ApiModelProperty(value = "组织创建时间", dataType = "Date")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "状态 1、正常 0、异常", dataType = "String")
    private String status;
}
